Skip to content

[wasm] [debugger] First version of multithreaded debugging#74820

Merged
thaystg merged 54 commits into
dotnet:mainfrom
thaystg:thays_support_multithreaded_debugging
Feb 1, 2023
Merged

[wasm] [debugger] First version of multithreaded debugging#74820
thaystg merged 54 commits into
dotnet:mainfrom
thaystg:thays_support_multithreaded_debugging

Conversation

@thaystg

@thaystg thaystg commented Aug 30, 2022

Copy link
Copy Markdown
Member
cb1fd258-20f9-4648-89eb-78ddbd59a7d9.mp4

Build command:
.\build.cmd mono+libs -os browser /p:MonoWasmBuildVariant=multithread

Run debugger-tests command:
.\dotnet.cmd test src/mono/wasm/debugger/DebuggerTestSuite --filter DebuggerTests.MiscTests.TestDebugUsingMultiThreadedRuntime -e RuntimeConfiguration=Debug -e Configuration=Debug -e DebuggerHost=chrome -e WASM_TESTS_USING_VARIANT=multithreaded -e WasmEnableThreads=true

@ghost ghost added the area-Debugger-mono label Aug 30, 2022
@ghost ghost assigned thaystg Aug 30, 2022
@ghost

ghost commented Aug 30, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details
cb1fd258-20f9-4648-89eb-78ddbd59a7d9.mp4
Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

@thaystg

thaystg commented Aug 30, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg thaystg requested a review from lambdageek August 30, 2022 21:12
@thaystg thaystg marked this pull request as ready for review September 1, 2022 16:53
@radical

radical commented Sep 1, 2022

Copy link
Copy Markdown
Member

The Wasm.Build.Tests failures are #74944 .

Comment thread src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs Outdated

@lambdageek lambdageek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C code and TS code lgtm.

I'd like someone more familiar with the debug proxy to review that part

@radical

radical commented Sep 27, 2022

Copy link
Copy Markdown
Member

needs to merge main

Comment thread src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs Outdated
Comment thread src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs Outdated
Co-authored-by: Ankit Jain <radical@gmail.com>
@thaystg

thaystg commented Jan 30, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Jan 30, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Jan 30, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Jan 30, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Jan 31, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Jan 31, 2023

Copy link
Copy Markdown
Member Author

@radical @lambdageek Could you please do a final review so I can merge?

@lambdageek lambdageek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C and TypeScript lgtm. I tried to follow BrowserDebugProxy, but I'm not sure if I completely understand it

#
# Evaluate paths
#
- template: /eng/pipelines/common/evaluate-default-paths.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now. But in a follow up we should change this to use these from runtime-extra-platforms-wasm.yml with a new debuggerTestsOnly parameter.

Comment thread eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml Outdated

throw new Exception($"Invalid internal state, waiting for {what} while another wait is already setup");
}
else if (nextNotifications.TryDequeue(out var notification))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the next notification in the queue is for a different string what?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll push some changes and it will be throwing an exception if it's a different string what

Comment on lines +217 to +221
await Client.SendCommand(sessionIdNewTarget, "Profiler.enable", null, token);
await Client.SendCommand(sessionIdNewTarget, "Runtime.enable", null, token);
await Client.SendCommand(sessionIdNewTarget, "Debugger.enable", null, token);
await Client.SendCommand(sessionIdNewTarget, "Runtime.runIfWaitingForDebugger", null, token);
await Client.SendCommand(sessionIdNewTarget, "Debugger.setAsyncCallStackDepth", JObject.FromObject(new { maxDepth = 32}), token);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a follow up PR - the commands here, and in DebuggerTestBase.InitializeAsync should use the same base set of commands. And each case can add any additional ones as needed. Like the ones here seem to be the same.

@thaystg

thaystg commented Feb 1, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg

thaystg commented Feb 1, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg thaystg merged commit ac18cc9 into dotnet:main Feb 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants